<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>New Document</TITLE>
<meta http-equiv="Cotent-Type" content="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<link rel="STYLESHEET" type="text/css" href="../../../widget/beautystyle/beautystyle.css">
<link rel="STYLESHEET" type="text/css" href="validate.css">
<script type="text/javascript" src="../../../js/jquery.js"></script>
<script type="text/javascript" src="../../../js/TC.js"></script>
<script type="text/javascript" src="jquery.iff.validate.js"></script>
</HEAD>

<BODY>
<div class="dijitTooltip dijitTooltipRight" style="top: 116px; left: 704.7px; opacity: 1;">
<div class="dijitTooltipContainer dijitTooltipContents">Enter Name (required)</div>
<div class="dijitTooltipConnector"></div>
</div>
<form action="" method="POST">
<table width="100%">
	<tr>
		<td>必需字段 class="validate required"</td>
		<td><input type="text" class="validate required"></td>
	</tr>
	<tr>
		<td>必需字段 class="validate required"</td>
		<td><input type="text" class="validate required"></td>
	</tr>
	<tr>
		<td>最小值 class="validate min-32"</td>
		<td><input type="text" class="validate min-32"></td>
	</tr>
	<tr>
		<td>最大值 class="validate max-32"</td>
		<td><input type="text" class="validate max-32"></td>
	</tr>
	<tr>
		<td>最小长度 class="validate minlength-32"</td>
		<td><input type="text" class="validate minlength-32"></td>
	</tr>
	<tr>
		<td>最大值 class="validate maxlength-32"</td>
		<td><input type="text" class="validate maxlength-32"></td>
	</tr>
	<tr>
		<td>英文字符、数字、下划线 class="validate word"</td>
		<td><input type="text" class="validate word"></td>
	</tr>
	<tr>
		<td>英文字符、数字、下划线，数字不能开头 class="validate methodname"</td>
		<td><input type="text" class="validate methodname"></td>
	</tr>
	<tr>
		<td>中英文字符、数字、下划线，数字不能开头 class="validate javamethodname"</td>
		<td><input type="text" class="validate javamethodname"></td>
	</tr>
	<tr>
		<td>日期格式：yyyy-MM-dd class="validate datecn"</td>
		<td><input type="text" class="validate datecn"></td>
	</tr>
	<tr>
		<td>日期格式：dd-MM-yyyy class="validate dateau"</td>
		<td><input type="text" class="validate dateau"></td>
	</tr>
	<tr>
		<td>中文：dd-MM-yyyy class="validate chinese"</td>
		<td><input type="text" class="validate chinese"></td>
	</tr>
	<tr>
		<td>数字： class="validate number"</td>
		<td><input type="text" class="validate number"></td>
	</tr>
	<tr>
		<td>文件名[中英文数字下划线.英文]： class="validate filename"</td>
		<td><input type="text" class="validate filename"></td>
	</tr>
	<tr>
		<td>自动转换为小写字符： class="validate tolowercase"</td>
		<td><input type="text" class="validate tolowercase"></td>
	</tr>
	<tr>
		<td>自动转换为大写字符： class="validate touppercase"</td>
		<td><input type="text" class="validate touppercase"></td>
	</tr>
	<tr>
		<td>提交表单前验证</td>
		<td>jQuery(document).ready( function(){ jQuery("form").submit(function(){ return
		jQuery('.validate').validate({submit:true}); }); } );</td>
	</tr>
	<tr>
		<td><input type="submit" value="提交"></td>
		<td><input type="reset" value="取消"></td>
	</tr>
</table>
</form>
<hr />
扩展： validate.js中有三个数组属性methods:{}，tests: {}，messages: {} 其中验证的方法都放在methods:{}中，如果带有参数的验证那么需要在tests:
{}中添加方法把参数分离出来 而messages: {}中放置错误信息（未有国际化）
</BODY>
<script type="text/javascript">
jQuery(document).ready(
	function(){
		jQuery("form").submit(function(){
			return jQuery('.validate').validate({submit:true});
		});
	}
);
</script>
</HTML>
